<template>
    <div style="height: 100vh; background-color: #F2f2f2;">
        <van-nav-bar left-text="返回" left-arrow @click-left="onClickLeft" />
        <div style="background-color: #FFFEEC; padding: 10px 15px; font-size: 14px;">
            请在 <span style="color: red;"> 半小时内 </span> 完成付款，否则系统自动取消订单
        </div>
        <div class="van-cell" style="margin-top: 10px;">
            <div class="van-cell__title"><span>订单编号</span></div>
            <div class="van-cell__value"><span>{{ orderSn }}</span></div>
        </div>
        <div class="van-cell">
            <div class="van-cell__title"><span>实际金额</span></div>
            <div class="van-cell__value"><span style="color: red;">￥{{ actualPrice }}.00</span></div>
        </div>
        <div style="padding: 15px; background-color: white; margin-top: 20px; font-size: 14px;">选择支付方式</div>
        <div data-v-69f6685c="" class="van-cell">
            <div data-v-69f6685c="" class="van-cell__title"><img data-v-69f6685c=""
                    src="http://vvweb.gitee.io/qyg-front/static/img/ali_pay.41a79780.png" alt="支付宝" width="82" height="29">
            </div>
            <div data-v-69f6685c="" class="van-cell__value">
                <div data-v-69f6685c="" role="radio" tabindex="-1" aria-checked="false" class="van-radio">
                    <van-radio-group v-model="radio">
                        <van-radio name="1"></van-radio>

                    </van-radio-group>
                </div>
            </div>
        </div>
        <div data-v-69f6685c="" class="van-cell">
            <div data-v-69f6685c="" class="van-cell__title"><img data-v-69f6685c=""
                    src="http://vvweb.gitee.io/qyg-front/static/img/wx_pay.2731abb7.png" alt="微信支付" width="113" height="23">
            </div>
            <div data-v-69f6685c="" class="van-cell__value">
                <div data-v-69f6685c="" role="radio" tabindex="0" aria-checked="true" class="van-radio">
                    <van-radio-group v-model="radio">
                        <van-radio name="2"></van-radio>
                    </van-radio-group>
                </div>
            </div>
        </div>
        <button class="but" @click="but">去支付</button>
    </div>
</template>
<script>
import { pandss,h5payss } from '@/api/index';
import { Dialog } from 'vant';
export default {
    name: "orderpay",
    data() {
        return {
            orderSn: "",
            actualPrice: "",
            radio: '1',
            that:""
        }
    },
    methods: {
        but(){
            if (this.radio=='1') {
                Dialog({ message: '你选择了支付宝支付' });
                h5payss({orderId: this.that}).then(res => {
                    console.log(res)
            })
            }else if (this.radio=='2') {
                Dialog({ message: '你选择了微信支付' });
            }
        },
        onClickLeft() {
            this.$router.go(-1)
        },
    },
    mounted() {
        this.that=this.$route.query.id
        var that = this.$route.query.id
        console.log(that)
        pandss({ orderId: that }).then(res => {
            this.orderSn = res.data.data.orderInfo.orderSn
            this.actualPrice = res.data.data.orderInfo.actualPrice
        })
    }
}
</script>
<style lang="scss">
.but{
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 44px;
    background-color: #07C160;
    color: white;
    border: none;
}
</style>